﻿namespace VisualPhysics.Scene.Core

open System.Drawing

/// Object interface which all physical objects will inherit from.
type Object =
    /// The type of the object.
    abstract member Tag : Shape
    /// The time of the last update.
    abstract member LastSync : float<s>
    /// The position of the object as a tuple in centimeters.
    abstract member CarPosition : (float<cm> * float<cm>)
    /// The position of the object as an MVector of cm centimeters.
    abstract member PolPosition : MVector<cm>
    /// The position of the object on the X axis in centimeters.
    abstract member X : float<cm>
    /// The position of the object on the Y axis in centimeters.
    abstract member Y : float<cm>
    /// The current velocity of the object.
    abstract member Velocity : MVector<cm / s>
    /// The color of the object.
    abstract member Color : Brush
    /// The mass of the object in gram.
    abstract member Mass : float<gram>
    /// <summary>Updates the object's position and velocity to a given time with given set of forces.</summary>
    /// <param name="ForceSet">The AccelerationManager which will be used to calculate new velocity and position.</param>
    /// <returns>The updates Object.</returns>
    abstract member Sync : forceSet:AccelerationManager -> time:float<s> -> Object
    /// <summary>Returns a new object with the new position.</summary>
    /// <param name="NewPosition">The new position as a tuple in centimeters.</param>
    /// <returns>The new Object.</float>
    abstract member SetCarPosition : newPosition:(float<cm> * float<cm>) -> Object
    /// <summary>Returns a new object with the new position.</summary>
    /// <param name="NewPosition">The new position as an MVector of cm.</param>
    /// <returns>The new Object.</float>
    abstract member SetPolPosition : newPosition:MVector<cm> -> Object
    /// <summary>Returns a new object with the new color.</summary>
    /// <param name="NewColor">The new color.</param>
    /// <returns>The new Object.</returns>
    abstract member SetColor : newColor:Brush -> Object
    /// <summary>Draws the object using a given System.Drawing.Graphics.</summary>
    /// <param name="Graphics">The graphics which will be used to draw.</param>
    abstract member Draw : g:Graphics -> unit